r_squared Function

public pure function r_squared(x, xm) result(rst)

Computes the R-squared value for a data set.

The R-squared value is computed by determining the sum of the squares of the residuals: The total sum of the squares: . The R-squared value is then: .

See Also:

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x(:)

An N-element array containing the dependent variables from the data set.

real(kind=real64), intent(in) :: xm(:)

An N-element array containing the corresponding modeled values.

Return Value real(kind=real64)

The result.